package com.study.zouchao.superproject.searchweather;

import com.study.zouchao.superproject.searchweather.entity.WeatherEntity;

import okhttp3.Call;
import okhttp3.OkHttpClient;
import okhttp3.Request;

/**
 * Created by Administrator on 2017/6/3.
 */

public class SearchWeatherModel {
    private static final String URL = "http://guolin.tech/api/weather?cityid=CN101230201&key=6386e297bac249c5a267460f1b2c7da0";
    public interface IGetWeatherListener {
        void onSuccess(WeatherEntity weatherEntity);
        void onFailure(Throwable throwable, String msg);
    }
    private IGetWeatherListener mListener;
    public Call conn() {
        OkHttpClient okHttpClient = new OkHttpClient();
        final Request request = new Request.Builder()
                .url(URL)
                .build();
        Call call = okHttpClient.newCall(request);
        return call;
    }
}
